load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "state",
    srcs = [
        "change.go",
        "config_loader.go",
        "helpers.go",
        "impl.go",
        "liveness.go",
        "load.go",
        "new_state.go",
        "split_decider.go",
        "state.go",
        "state_listener.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/asim/state",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/config/zonepb",
        "//pkg/gossip",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/allocator",
        "//pkg/kv/kvserver/allocator/allocatorimpl",
        "//pkg/kv/kvserver/allocator/storepool",
        "//pkg/kv/kvserver/asim/config",
        "//pkg/kv/kvserver/asim/workload",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/kv/kvserver/load",
        "//pkg/kv/kvserver/split",
        "//pkg/raft",
        "//pkg/raft/raftpb",
        "//pkg/raft/tracker",
        "//pkg/roachpb",
        "//pkg/settings/cluster",
        "//pkg/spanconfig",
        "//pkg/spanconfig/spanconfigreporter",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_google_btree//:btree",
        "@org_golang_google_protobuf//proto",
    ],
)

go_test(
    name = "state_test",
    srcs = [
        "change_test.go",
        "config_loader_test.go",
        "liveness_test.go",
        "split_decider_test.go",
        "state_test.go",
    ],
    embed = [":state"],
    deps = [
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/asim/config",
        "//pkg/kv/kvserver/asim/workload",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/kv/kvserver/load",
        "//pkg/roachpb",
        "//pkg/util/hlc",
        "@com_github_stretchr_testify//require",
    ],
)
